Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement __iter__ and __aiter__ in DocumentCollection #231

Merged
merged 2 commits into from
Oct 3, 2023

Conversation

adnejacobsen
Copy link
Contributor

@adnejacobsen adnejacobsen commented Oct 3, 2023

DocumentCollection can now be treated as an iterator and async iterator, enabling async iteration with the async for .. in .. syntax.

Some improvements in pit functionality:

  • Use the updated pit id
  • Pass pit to case returned by Explorer.get_case_by_uuid (bug fix)

We are not deleting the pit, which is recommended. This is currently not possible because SumoClient.delete does not take params which is needed to call the DELETE /api/v1/pit endpoint.

Closes #228

@adnejacobsen adnejacobsen requested review from a team and anders-kiaer October 3, 2023 11:43
Copy link
Contributor

@equinor-ruaj equinor-ruaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@adnejacobsen adnejacobsen merged commit 138955f into main Oct 3, 2023
9 checks passed
@adnejacobsen adnejacobsen deleted the document-collection-iteration branch October 3, 2023 12:52
@equinor-ruaj equinor-ruaj mentioned this pull request Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Recommended async compatible way of iterating over document collection
2 participants